using System.Data;

namespace System.Web.Core
{
    public class CommandParameter
    {
        private string classMember;
        private string parameterName;
        private string dbTypeHint;
        private ParameterDirection parameterDirection;

        public CommandParameter()
        {
        }
        public CommandParameter(string classMember, string initParameterName, string initDbTypeHint, string initParameterDirection)
        {
            this.classMember = classMember;
            this.parameterName = initParameterName;
            this.dbTypeHint = initDbTypeHint;
            this.ParamDirection = initParameterDirection;
        }

        public string ClassMember
        {
            get
            {
                return classMember;
            }
            set
            {
                classMember = value;
            }
        }
        public string ParameterName
        {
            get
            {
                return parameterName;
            }
            set
            {
                parameterName = value;
            }
        }
        public string DbTypeHint
        {
            get
            {
                return dbTypeHint;
            }
            set
            {
                dbTypeHint = value;
            }
        }
        public string ParamDirection
        {
            get
            {
                return parameterDirection.ToString();
            }
            set
            {
                if (value == "Input")
                    parameterDirection = ParameterDirection.Input;
                else if (value == "InputOutput")
                    parameterDirection = ParameterDirection.InputOutput;
                else if (value == "Output")
                    parameterDirection = ParameterDirection.Output;
                else
                    parameterDirection = ParameterDirection.ReturnValue;
            }
        }
        public ParameterDirection RealParameterDirection
        {
            get
            {
                return parameterDirection;
            }
        }
    }
}
